package operation;

import java.util.Comparator;
import book.Book;
class NameCompare implements Comparator<Book>{

    @Override
    public int compare(Book o1, Book o2) {
        if(o1==null){
            if(o2==null){
                return 0;
            }
            return -1;
        }
        if(o2==null){
            return 1;
        }
        return o1.getName().compareTo(o2.getName());
    }
}
